<?php
include_once '../data/database_dal.php';

class UserDAL extends DatabaseDAL
{
    public function update($id, $email, $passwd, $telephone, $details, $company, $firstName, $lastName, $address1, $address2,
        $city, $country, $province, $zipCode, $currency, $jobFunction, $hearUS, $cadUsed, $compenents, $materialSpend,
        $supplierType, $lowCost, $industry, $employees, $userType, $inTime, $inUser)

    {
        $this->connect();
        $result = $this->mysqli->query("call pr_user_update('". $id ."', '". $email ."', '". $passwd ."', '". $telephone ."', '". $details ."',
                                                                 '". $company ."', '". $firstName ."', '". $lastName ."', '". $address1 ."', '". $address2 ."',
                                                                 '". $city ."', '". $country ."', '". $province ."', '". $zipCode ."', '". $currency ."',
                                                                   '". $jobFunction ."', '". $hearUS ."', '". $cadUsed ."', '". $compenents ."', '". $materialSpend ."',
                                                                '". $supplierType ."', '". $lowCost ."', '". $industry ."', '". $employees ."', '". $userType ."', '". $inTime ."', '". $inUser ."')");
            $this->close();
            return $result;
        }

        public function get($where)
        {
            $this->connect();
            return $this->mysqli->query("call pr_user_get(".'"'.$where.'"'.")");
            $this->close();
            return $result;    
        }

    public function getAll()
    {

    }

    public function validate($id, $email)
    {
        $this->connect();
        $result = $this->mysqli->query("call pr_user_validate('". $id ."', '". $email ."')");
        $this->close();
        return $result;
    }

    public function delete($id)
    {
        $this->connect();
        $result = $mysqli->query("call pr_user_delete('". $id ."')");
        $this->close();
        return $result;
    }
}

?>
